package cz.semjob.output;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.hp.hpl.jena.ontology.OntModel;

import cz.semjob.framework.DocumentAnnotationResults;
import cz.semjob.output.data.EnrichmentOutput;

@Component
public class EnrichmentOutputter {
	
	@Autowired
	private RDFExport rdfExport;
	@Autowired EnrichmentOutputProcessor outputProcessor;

	public EnrichmentOutputter() {
		// TODO Auto-generated constructor stub
	}
	
	public String createResultOutput(List<DocumentAnnotationResults> annotationResults, String ontologyPath) {
		EnrichmentOutput enrichmentOutput = outputProcessor.processOutput(annotationResults);
		OntModel model = rdfExport.createModel(enrichmentOutput, ontologyPath);
		return rdfExport.modelToString("TURTLE", model);
		
		
	}

	public void setRdfExport(RDFExport rdfExport) {
		this.rdfExport = rdfExport;
	}

	public void setOutputProcessor(EnrichmentOutputProcessor outputProcessor) {
		this.outputProcessor = outputProcessor;
	}
	
	
	
	

}
